<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

</body>
<script>

    function SuperType(name) {
        this.name = name;
        this.roles=['admin','manager']
    }

    SuperType.prototype.say=function () {
        alert(this.name);
    }

    function SubType(name,age) {
        SuperType.call(this,name);
        this.age=age;
    }

    SubType.prototype = new SuperType();
   // SubType.prototype.constructor = SubType;
    SubType.prototype.alertAge = function () {
        alert(this.name+':'+this.age);
    }


    var sub1= new SubType('L',34);
  //  alert(sub1.name);
    sub1.say();
    sub1.alertAge();


</script>
</html>